class RequestResult<T> {
  final String? code;
  final String? msg;
  final T? data;

  RequestResult({this.code, this.msg, this.data});

  RequestResult.fromJson(Map<String, dynamic> json)
      : code = json['code'] ?? '',
        msg = json['msg'] ?? '',
        data = json['data'] ?? {};

  @override
  String toString() {
    StringBuffer sb = StringBuffer('{');
    sb.write(",\"code\":$code");
    sb.write(",\"msg\":\"$msg\"");
    sb.write(",\"data\":\"$data\"");
    sb.write('}');
    return sb.toString();
  }
}
